<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
	<head>

<title>附件上传</title>
<link rel="stylesheet" href="<s:url value="/css/style_new.css"/>">
<script src="<s:url value="/script/jquery_last.js"/>" type="text/javascript"></script>
<script type="text/javascript" src="<s:url value="/script/selfResize.js"/>"></script>
<script type="text/javascript" src="<s:url value="/components/datepicker/WdatePicker.js"/>"></script>
<script>

</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
      <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
        <tr>
					<td valign="top" align="center"><br>
					<s:form id="form1" name="form1" action="saveReqDocu.action" namespace="/security" method="post" enctype="multipart/form-data">
					  <input type="hidden" name="businessRequestId" value="${businessRequestId}">
					  <input type="hidden" name="processDetailId" value="${processDetailId}">
					  <table width="98%" border="1" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td colspan="3">
											<table width="100%" border="0" class=tablecolor2>
												<tr>
													<td width="60%" align="center" bgcolor="D6E3FA">附件名称</td>
													<td width="*" align="center" bgcolor="D6E3FA">附件类型</td>
													<td width="18%" align="center" bgcolor="D6E3FA">删除</td>
												</tr>
												<s:iterator id="reqDocu" value="curReqDocus">
												<input type="hidden" name="reqDocuIDs" value="<s:property value="id" />"/>
												<tr>
													<td>
														<a href="<s:url value="/bpm/showDocu.action?reqDocu.id="/><s:property value="id" />"
															target="_blank">
															<s:property value="fullName" />
														</a>
													</td>
													<td align="center">
								<s:if test="docType==null">
									其他附件
								</s:if>	
								<s:else>
									<s:property value="docType.name"/>
								</s:else>	
													</td>
													<td align="center"><input type="checkbox"
														name="delIDs" value="<s:property value="id" />"></td>
												</tr>
												</s:iterator>
											</table>
											<br>
                      <table width="100%" border="1" class=tablecolor2>
                        <tr>
                          <td width="" colspan="2" align="left" bgcolor="D6E3FA">附件上传</td>
                        </tr>
							<s:iterator id="documentType" value="documentTypes">
                  <tr>
										<td>
											<div align="left" class="STYLE2"><font color="red">*</font><s:property value="docType.name"/></div>
						<input type="hidden" name="docTypeId" value="${docType.id}">
										</td>
                    <td align="left">
                    	<input type="file" name="upload" size="40" value=""/>
                    </td>
                  </tr>
            	</s:iterator>
                        <tr>
                          <td>其他附件</td>
                          <td><input type="file" name="otherFile" size="40"/>
                          </td>
                        </tr>
                        <tr>
                          <td>其他附件</td>
                          <td><input type="file" name="otherFile" size="40"/>
                          </td>
                        </tr>
            			<tr>
            				<td colspan="3" >
            					<input type="button" value="附件提交" name="附件提交" onclick="sure()">
										</td>
									</tr>
                        
                      </table>
                      
                      
                      </td>
                  </tr>
					  	

						</table>
					</s:form>
				</td>
			</tr>
	  </table>
</body>
<script>

function sure(){
	test();
	document.all['form1'].submit();
	
	
}
function test(){
	var docTypeId=document.getElementsByName("docTypeId");
	var upload=document.getElementsByName("upload");
	for(var i=upload.length;i>0;i--){
		if(upload[i-1].value==""){
			docTypeId[i-1].outerHTML="";
			upload[i-1].outerHTML=="";
		}
	}
}

</script>
</html>
